-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AnglePickerControl
: Style to better fit in narrow contexts and improve RTL layout
#49046
Conversation
Thanks for the PR! I'm not sure it's good to change the morphology of the angle picker quite yet. I don't hate the line, but I also don't think it's necessarily clearer that it points in a particular direction. I think there's an opportunity to refine the design, to be clear, but it might be best to keep that separate from the other excellent bugfixes. What do you think? |
de51103
to
7c2c8e3
Compare
It's great! Also it's done. I've updated the PR description and screenshots. It's funny how that gap has bugged me for quite some time. I just got a little tunnel vision on that other idea. Thanks for getting your hands dirty there Joen! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Before, cropped text in the angle field:
After, uncropped:
I'm mainly reviewing this visually, so I'd appreciate a sanity check from a dev (maybe cc @mirka?). But otherwise, looks good, thanks for the PR!
return ( | ||
<Root | ||
{ ...restProps } | ||
ref={ ref } | ||
__nextHasNoMarginBottom={ __nextHasNoMarginBottom } | ||
className={ classes } | ||
gap={ 4 } | ||
gap={ 2 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
import CONFIG from '../../utils/config-values'; | ||
|
||
import type { AnglePickerControlProps } from '../types'; | ||
|
||
const CIRCLE_SIZE = 32; | ||
const INNER_CIRCLE_SIZE = 3; | ||
const INNER_CIRCLE_SIZE = 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this one actually do? Mostly for curiosity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the size of the dot on the knob. Previously it was used as a radius. As part of simplifying the styles used to draw the dot it was more straightforward to use as a diameter (which also makes it consistent with CIRCLE_SIZE
which is a diameter).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting, thanks for the response! I don't know that we'd ever want to actually change the size of the knob situationally, so I guess it good that it isn't surfaced as a prop :)
@@ -39,31 +40,33 @@ export const CircleRoot = styled.div` | |||
height: ${ CIRCLE_SIZE }px; | |||
overflow: hidden; | |||
width: ${ CIRCLE_SIZE }px; | |||
|
|||
:active { | |||
cursor: grabbing; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice fixes, thank you! Let us know when this is ready for a full code review 🙂 It might be worth splitting this into at least two PRs since it's touching several independent concerns. Would be easier to pin down if there are any regressions.
7c2c8e3
to
2fd322d
Compare
AnglePickerControl
AnglePickerControl
Thanks for testing and reviewing Joen! I've taken Lena’s advice and dropped any changes here besides the visual stuff. So I'll go ahead and mark this as ready. Oh that and add to the changelog. |
Flaky tests detected in 6835eea. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4450374242
|
2fd322d
to
650b716
Compare
AnglePickerControl
AngleControlPicker
: Style to better fit in narrow contexts and improve RTL layout
AngleControlPicker
: Style to better fit in narrow contexts and improve RTL layoutAnglePickerControl
: Style to better fit in narrow contexts and improve RTL layout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for the polish! 🚀
marginTop: 'auto', | ||
} } | ||
> | ||
<Spacer marginBottom="1" marginTop="auto"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Not for this PR, but for layouts like this I'd probably first try using the NumberControl without a label, and wrap the entire thing in a separate BaseControl. I hope our components support that kind of composability without messing up the HTML semantics.
packages/components/CHANGELOG.md
Outdated
@@ -9,6 +9,7 @@ | |||
- `FontSizePicker`: Allow custom units for custom font size control ([#48468](https://github.com/WordPress/gutenberg/pull/48468)). | |||
- `Navigator`: Disable initial screen animation ([#49062](https://github.com/WordPress/gutenberg/pull/49062)). | |||
- `FormTokenField`: Hide suggestions list on blur event if the input value is invalid ([#48785](https://github.com/WordPress/gutenberg/pull/48785)). | |||
- `AnglePickerControl`: Style to better fit in narrow contexts and improve RTL layout ([#49046](https://github.com/WordPress/gutenberg/pull/49046)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be moved up again, there was a release a few days ago. (When will we be free from this merge annoyance? 🥲)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
1f9e1fe
to
6835eea
Compare
6835eea Restores a bit of style whose removal was part of proposed changes to focus handling that were dropped from this PR. Ultimately it’s a non-change, so I'll merge without further review. Thanks again to Joen and Lena 🙇 |
What?
Why?
GradientPicker
value gets cut off in block editor sidebarPopovers
#45781How?
prefix
prop for the angle symbol when RTLTesting Instructions
Testing Instructions for Keyboard
Nothing has really changed for pure keyboard use. The knob is not tabbable in either trunk or this branch.
Screenshots or screencast
Archived from earlier iterations
In Post Editor adjusting a gradient
angle-picker-control-knob-affixed.mp4
Note the easy keyboard adjustment after dragging since the number input is already focused.
In Global Styles
Other screenshots to show design alternatives
A before/after of just moving the knob “inside” without other style changes
A style experiment I tried along the way
angle-picker-control-try-alt-style.mp4